###readme.txt

This folder contains the replication files for Enos, Ryan D. and Christopher
Celaya. "The Effect of Segregation on Intergroup Relations,"Journal of
Experimental Political Science.

***To replicate this manuscript*** run "replication_master.r" by typing
"source('replication_master.r')" into the R terminal. This will use pre-processed
data to output tables in the manuscript. It does so by calling "faces_analyze.r"
to produce Tables 1, S1, and S2. And "minimal_groups_analyze.r" to produce
Tables 2, S3, and S4. It also calls: "minimal_groups_analyze_firstrow.r",
"minimal_groups_analyze_men.r", "minimal_groups_analyze_large_group.r",
"minimal_groups_analyze_identity1.r",
"minimal_groups_analyze_identity2.r",
"minimal_groups_analyze_identity3.r",
"minimal_groups_analyze_nonskeptics.r",
"minimal_groups_analyze_notrim.r", and "summary_stats_table.r"
 to produce Tables S5-S13.

**Prior to executing the scripts, the R terminal should be pointed to the
directory in which the replication files are located, which can be accomplished
by typing "setwd('..')" where ".." is the local file structure where the replication
files are located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute replication_master.r, you may need to install the packages used,
this can be accomplished by typing the following in the R terminal:
install.packages("xtable"); install.packages("ri"); install.packages("effsize");
install.packages("RItools")

Questions? Please contact Ryan Enos (renos@gov.harvard.edu).

************************************************************** ***

There is are six.csv files associated with these scripts. Descriptions each csv, the
processing steps to create this data, and the variables includes are below.

***faces_data.csv***

This includes all data for experiment 1 to produce Tables Tables 1, S1, and S2.

This data was pre-processed in R to merge data from Qualtrics .csv files from
five separate trials, remove the outer 5 percent quantiles of time used to
complete the experiments, and to remove personally identifying information
and unneeded demographic variables collected by DLABSS.

"white.int": Likert-scale responses from 1 "Very African-American" to 7 "Very
Caucasian" when ambiguous face is integrated

"white.seg": response when ambiguous face is segregated with white faces

"black.int": response when ambiguous face is integrated

"black.seg": response when face is segregated with Black faces

"white.seg.int": white.seg minus white.int

"black.seg.int": black seg minus black.int

"us.resident": is the subject a self-described United States resident? 0/1

"male": is the subject a self-described male? 0/1

"non.white": is the subject self-described as non-white or white? 0/1

"hispanic": is the subject self-described as hispanic? 0/1

"english": does the subject report speaking English at home? 0/1

"conservative": is the subject a self-described conservative? 0/1

"left.handed": is the subject self-described as left-handed? 0/1

"college.grad": does the subject report having a college degree? 0/1

"income": self reported income in dollars

"age": self reported age in years

"test": trial number from 1 to 5


##############

**************"money_dat.csv", "attribution_dat.csv", "social_dat.csv",
"physical_dat.csv", "physical_dat_notrim.csv", and
"minimal_groups_dat.csv"********

These are the data from experiment 2 used to create Tables 2, and S3 - S12.
Each contains the same variables, except the five variables noted below that are
included only in "physical_dat.csv" because these were created after removing
outliers as described in the article (these are also included in
"physical_dat_notrim.csv"). Each dataset is then subset to the data used to do
the analyses on allocation, negative attribution, social perceptions, and physical
perceptions, respectively. "minimal_groups_dat.csv" is all the data from the
minimal groups experiment combined.

Data was preprocessed using R to combine separate Qualtrics .csv files
 across experimental sessions, recode covariates, and drop personally identifying information from recruitment surveys.  To create "money_dat.csv", "attribution_dat.csv", "social_dat.csv", "physical_dat.csv", and  "physical_dat_notrim.csv", data was processed to drop missing responses and outliers on the physical perception scales.


"Block.ID": session ID

"perceptual.type": randomly assigned minimal group: H or Y

"treatment.assignment": assigned to integrated or segregated treatment 0/1

"first.row.seat": sitting in first row of treatment "waiting room"? 0/1

"male": self-described as male 0/1

"large.group": were subjects in a group of larger than the median group size (8)
(see Supporting Information Table S7) 0/1

"non.white": self-described as non-white 0/1

"high.ingroup.identify.1": Subjects with high ingroup identity, as described in
Supporting Information Table S8 0/1

"high.ingroup.identify.3": Subjects with high ingroup identity, as described in
Supporting Information Table S9 0/1

"high.ingroup.identify.4": Subjects with high ingroup identity, as described in
Supporting Information Table S10 0/1

"disbelief": Subjects expressing skepticism about validity of arbitrary group
assignment in open-ended responses 0/1


"hispanic": self-described as Hispanic 0/1

"college.grad": self-described as college graduate 0/1

"age": self-reported age in years

"weight": self-reported weight in pounds

"self.height": self-reported height in inches

"income.recode": self-reported income in dollars

"Y.income.recode": perception of average income for Y group

"H.income.recode": perception of average income for H group

"conservative": self-reported conservative 0/1

"ingroup.money": money allocated to the ingroup in dollars

"outgroup.money": money allocated to the outgroup in dollars

"allocated.diff": ingroup minus outgroup money allocation

"ingroup.capable": seven point Likert scale agreement that ingroup is "capable"
(reverse coded, so higher numbers mean less capable)

"outgroup.capable": seven point Likert scale agreement that outgroup is
"capable" (reverse coded, so higher numbers mean less capable)

"capable.diff": ingroup.capable minus outgroup.capable

"ingroup.intelligent": seven point Likert scale agreement that ingroup is
"intelligent" (reverse coded, so higher numbers mean less intelligent)

"outgroup.intelligent": seven point Likert scale agreement that outgroup is
"intelligent" (reverse coded, so higher numbers mean less intelligent)

"intelligent.diff": outgroup.intelligence minus ingroup.intelligence

"ingroup.stupid": seven point Likert scale agreement that ingroup is "stupid"

"outgroup.stupid": seven point Likert scale agreement that outgroup is "stupid"

"stupid.diff": outgroup.stupid minus ingroup.stupid

"ingroup.incompetent": seven point Likert scale agreement that ingroup is
"incompetent"

"outgroup.incompetent": seven point Likert scale agreement that outgroup is
"incompetent"

"incompetent.diff": outgroup.incompetent minus ingroup.incompetent

"attribution.diff": mean of capable.diff, intelligent.diff, stupid.diff', and
incompetent.diff

"ingroup.common": seven point LIkert scale agreement that subject has things
in common with ingroup

"outgroup.common": seven point LIkert scale agreement that subject has things
in common with outgroup

"common.diff": outgroup.common minus ingroup.common

"common.diff.scale": common.diff rescaled

"poli_self_Y": difference between own political ideology (1 to 5, five being most
conservative) and perceived average Y group ideology

"poli_self_H": difference between own political ideology and perceived average
H group ideology

"ingroup.poli.diff": difference between own political ideology and perceived
average ingroup ideology

"outgroup.poli.diff": difference between own political ideology and perceived
average outgroup ideology

"all.poli.diff": ingroup.poli.diff minus outgroup.poli.diff

"poli.diff.scale": all.poli.siff rescaled

"income.self.Y": difference between own income and perceived average Y group
income

"income.self.H": difference between own income and perceived average H group
income

"ingroup.income.diff": difference between own income and perceived average
ingroup income

"outgroup.income.diff": difference between own income and perceived average
outgroup income

"all.income.diff": ingroup.income.diff minus outgroup.income.diff

"income.diff.scale": all.income.diff rescaled

"social.diff.scale": mean of income.diff.scale, poli.diff.scale, and
common.diff.scale

"age.self.Y": difference between own age and perceived average Y group age in
years

"age.self.H": difference between own age and perceived average H group age in
years

"ingroup.age.diff": difference between own age and perceived average ingroup
age

"outgroup.age.diff": difference between own age and perceived average
outgroup age

"all.age.diff": ingroup.age.diff - outgroup.age.diff

"weight.self.Y": difference between own weight and perceived average Y group
weight in pounds

"weight.self.H": difference between own weight and perceived average H group
weight

"ingroup.weight.diff": difference between own weight and perceived average
ingroup weight

"outgroup.weight.diff": difference between own weight and perceived average
outgroup weight

"all.weight.diff": ingroup.weight.diff minus outgrop.weight.diff

"height.self.Y": difference between own height and perceived average Y group
height in inches

"height.self.H": difference between own height and perceived average H group
height in inches

"ingroup.height.diff": difference between own height and perceived average
ingroup height

"outgroup.height.diff": difference between own height and perceived average
outgroup height

"all.height.diff": ingroup.height.diff minus outgrop.height.diff

"ingroup.appearance": seven point LIkert scale agreement that subject has
things in common with ingroup when it comes to appearance

"outgroup.appearance": seven point LIkert scale agreement that subject has
things in common with outgroup when it comes to appearance

"appearance.diff": ingroup.appearance minus outgroup appearance.

####these variables below only appear in "physical_dat.csv" and
"physical_dat_notrim.csv"

"age.diff.scale": all.age.diff rescaled

"weight.diff.scale": all.weight.diff rescaled

"height.diff.scale": all.height.diff rescaled

"appearance.diff.scale": all.apperance.diff rescaled

"physical.diff.scale" mean of age.diff.scale, weight.diff.scale, height.diff.scale,
and appearance.diff.scale


##############

**************"summary_stats_table.r"********

These are the data from experiment 2 used to create Table 13.

Data was preprocessed using R to combine separate Qualtrics .csv files
 across experimental sessions, recode covariates, and drop personally identifying information from recruitment surveys. 
